// 选择商品

<template>
  <view class="mes-choose-goods" :style="{ marginTop: `${top}rpx` }">
    <view class="left" @tap="scanGoods">
      <view class="left-icon iconfont icon-tiaoxingma1"></view>
      <view class="left-label">扫码添加</view>
    </view>
    <view class="right" @tap="handGoods">
      <view class="right-icon iconfont icon-shoudong"></view>
      <view class="right-label">手动添加</view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    type: {
      type: String
    },
    top: {
      type: [Number, String],
      default: 0
    }
  },
  methods: {
    // 手动添加商品
    handGoods() {
      uni.navigateTo({ url: `/pages/common/goods?type=${this.type}` })
    },
    // 扫描商品
    scanGoods() {
      uni.navigateTo({ url: `/pages/common/scan?type=${this.type}` })
    }
  }
}
</script>


<style lang="less" scoped>
.mes-choose-goods {
  width: 702rpx;
  height: 120rpx;
  background: #ffffff;
  border-radius: 16rpx;
  margin: 0 auto;
  padding: 20rpx 0;
  display: flex;

  .left,
  .right {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    .iconfont {
      margin-right: 14rpx;
      color: #1a96ff;
      font-size: 32rpx;
      font-weight: 500;
    }
  }
  .right {
    border-left: 1px solid #eeeeee;
  }
}
</style>
